#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <semaphore.h>

_PROTOTYPE ( int main, (void));
int main()
{
	sem_t a;
	int ids = 0;
        a.id=ids;
        while(sem_assign(&a,1,1) != -1){
       
              sem_destroy(&a);
              ids++;
              a.id = ids;      
        }
	return 0;
}
